<script setup>
defineProps({
  gamePrice: Object
})
const emit = defineEmits(["edit"])
const editHandle = () => {
  emit("edit", "gamePrice")
}
</script>

<template>
  <el-descriptions
      border :column="5" title="价格信息">
    <template #extra>
      <el-button @click="editHandle" type="success">修改</el-button>
    </template>
    <el-descriptions-item label="原始价格">{{ gamePrice.originPrice }}</el-descriptions-item>
    <el-descriptions-item label="当前价格">{{ gamePrice.currentPrice }}</el-descriptions-item>
    <el-descriptions-item label="折扣">{{ gamePrice.discount === 0 ? "无折扣" : (100 - gamePrice.discount) + '折' }}</el-descriptions-item>
    <el-descriptions-item v-if="gamePrice.discount !== 0" label="折扣开始时间">{{ gamePrice.discountStart }}</el-descriptions-item>
    <el-descriptions-item v-if="gamePrice.discount !== 0" label="折扣结束时间">{{ gamePrice.discountEnd }}</el-descriptions-item>
  </el-descriptions>
</template>

<style scoped>

</style>
